@using OrchardCore.Facebook.ViewModels;
@model FacebookSettingsViewModel;

<p class="alert alert-warning">@T["The current tenant will be reloaded when the settings are saved."]</p>

<h3>@T["Facebook Integration"]</h3>

<fieldset class="form-group" asp-validation-class-for="AppId">
    <label>@T["Application Identifier"]</label>
    <input asp-for="AppId" class="form-control" autocomplete="off"/>
    <span asp-validation-for="AppId"></span>
    <span class="hint">@T["The Application ID found on the Facebook developer portal parameters."]</span>
</fieldset>

<fieldset class="form-group" asp-validation-class-for="AppSecret">
    <label>@T["Secret Key"]</label>
    <input asp-for="AppSecret" class="form-control" type="password" value="@Model.AppSecret" autocomplete="off" />
    <span asp-validation-for="AppSecret"></span>
    <span class="hint">@T["The Application secret key found on the Facebook developer portal parameters."]</span>
</fieldset>

<div class="row">
    <div class="col-lg-6 col-xl-3">
        <label>@T["Javascript SDK Version"]</label>
    </div>
    <div class="col-lg-6 col-xl-9">
        <label>@T["Javascript Sdk js"]</label>
    </div>
    <fieldset class="form-group col-lg-6 col-xl-3" asp-validation-class-for="Version">
        <input asp-for="Version" class="form-control" value="@Model.Version" />
        <span asp-validation-for="Version"></span>
        <span class="hint">@T["Determines which versions of the Graph API and any API dialogs or plugins are invoked. Default is v3.2"]</span>
    </fieldset>

    <fieldset class="form-group col-lg-6 col-xl-3" asp-validation-class-for="SdkJs">
        <input asp-for="SdkJs" class="form-control" value="@Model.SdkJs" />
        <span asp-validation-for="SdkJs"></span>
        <span class="hint">@T["Determines which sdk js file to load. Default is sdk.js but you can change it as needed. Eg. to render the chat plugin use sdk/xfbml.customerchat.js and <a target=\"_blank\" href=\"https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin#steps\">follow instructions</a>"]</span>
    </fieldset>

    <fieldset class="form-group my-2 col-lg-6 col-xl-3" asp-validation-class-for="FBInit">
        <div class="form-check">
            <input class="form-check-input" asp-for="FBInit" type="checkbox" checked="@Model.FBInit" />
            <label class="form-check-label">@T["Init on every page"]</label>
        </div>
        <span asp-validation-for="FBInit"></span>
    </fieldset>
</div>

<fieldset class="form-group" asp-validation-class-for="FBInitParams">
    <label>@T["Parameters for the FB.init() call"]</label>
    <textarea asp-for="FBInitParams" class="form-control" rows="5"></textarea>
    <span asp-validation-for="FBInitParams"></span>
    <span class="hint">@T["AppId and Version are filled automatically. Check the <a target=\"_blank\" href=\"https://developers.facebook.com/docs/javascript/reference/FB.init/v3.2\">reference doc for the <code>FB.init</code></a> function for more info"]</span>
</fieldset>

